//Version.cpp
//Version Class
/*
Nathan Currier / Rideliner
	nathan.currier@gmail.com
	rideliner.uni.cc
ColorCoded
	http://code.google.com/p/colorcoded/
*/

#include <string>
#pragma warning(disable: 4996)
#include "Version.h"
using namespace std;

Version::Version(void) {} //declare constructor

Version::Version(int _a, int _b, int _c, int _d) //set constructor
{
	V_a = _a;
	V_b = _b;
	V_c = _c;
	V_d = _d;
}

Version::Version(Version &from) //copy constructor
{
	V_a = from.get_a();
	V_b = from.get_b();
	V_c = from.get_c();
	V_d = from.get_d();
}

Version::~Version(void) {}

void Version::set(int _a, int _b, int _c, int _d) //set with each individual int
{
	V_a = _a;
	V_b = _b;
	V_c = _c;
	V_d = _d;
}
int Version::get_a(void)
{
	return V_a;
}
void Version::set_a(int _a)
{
	V_a = _a;
}

int Version::get_b(void)
{
	return V_b;
}
void Version::set_b(int _b)
{
	V_b = _b;
}

int Version::get_c(void)
{
	return V_c;
}
void Version::set_c(int _c)
{
	V_c = _c;
}

int Version::get_d(void)
{
	return V_d;
}
void Version::set_d(int _d)
{
	V_d = _d;
}	

string Version::get_vers(string divider, bool quotes)
{
	char buf[5];
	string S_a, S_b, S_c, S_d;
	string _fin;

	S_a = itoa(V_a, buf, 10);
	S_b = itoa(V_b, buf, 10);
	S_c = itoa(V_c, buf, 10);
	S_d = itoa(V_d, buf, 10);

	_fin = (S_a + divider + S_b + divider + S_c + divider + S_d);
	if(quotes)
	{
		_fin = ('\"' + _fin + '\"');
	}

	return _fin;
}
